﻿
#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int fun(int n) {
    int count = 0;
    while (n != 0) {
        count++;
        n = n & (n - 1);
    }
    return count;
}
int main()
{
    int a = 0;
    scanf("%d", &a);
    printf("%d", fun(a));
    return 0;
}
